<%@page contentType="text/html;charset=UTF-8"%>
<%@ page import="whf.framework.web.Constants"%>

<%@taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tlds/framework.tld" prefix="framework"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><framework:attr source="STRUTS-META" attr="name" /></title>
<jsp:include page="/common/inc/select.jsp" />
</head>
<%
long workflowDefinitionId = whf.framework.util.ParamUtils.getLongParameter(request, "workflowDefinitionId", 0);
String queryString = " order by t.createDate desc";
if(workflowDefinitionId > 0) {
	queryString = "t.workflowDefinition.id=" + workflowDefinitionId + " order by t.createDate desc";
} 
 %>
<body>
<html:form action='<%=  (String)request.getAttribute(Constants.STRUTS_PATH) %>' method="post">
<html:hidden property="webMethod" value="list" />
<framework:ext />
<framework:query view="SYSTEM-WORKENTITY-QUERY" displayColumnCount="2" />
<framework:table pkStyle="checkbox_counter" navPosition="both" queryString="<%= queryString %>">
	<framework:rowext>
	<div nowrap><a href="WorkflowEntity.do?webMethod=view&id=${id}">查看明细</a></div>
	<% whf.framework.workflow.entity.WorkflowEntity workflowEntity = (whf.framework.workflow.entity.WorkflowEntity)request.getAttribute("currentRow"); 
	if(workflowEntity != null) {
		if(workflowEntity.getProcessInstanceId() == 0) {
	%>
	<div nowrap><a href="WorkflowEntity.do?webMethod=startProcessInstance&id=${id}">开始流程</a></div>
	<div nowrap><a href="WorkflowEntity.do?webMethod=resetWorkflowDefinition&id=${id}">设置流程</a></div>
	<%} 
	}%>
	</framework:rowext>
</framework:table>
<framework:funcbtn operation="prepareCreate" validationFunction="" valueKey="form.create" />
<framework:funcbtn operation="prepareUpdate" validationFunction="selectionMoreThanOne" valueKey="form.update" />
<framework:funcbtn operation="duplicate" 	validationFunction="selectionMoreThanOne" valueKey="form.duplicate" />
<framework:funcbtn operation="delete" 		validationFunction="selectionMoreThanOne" valueKey="form.delete" />
<html:reset><bean:message key="form.reset" /></html:reset>
</html:form>

</body>
</html> 